import React from 'react'
import { RootSate, useAPPDispatch } from '@/store'
import { AigcListType } from '@/types'

import AigcList from '@/components/AigcList'

import { useSelector } from 'react-redux'
import AigcCard from '@/components/AigcCard'

export default function UserinfoView() {
  const userInfo = useSelector((state: RootSate) => state.userInfo)

  const userInfoData = userInfo.value
  const userDispatch = useAPPDispatch()

  const userInfoColunm: AigcListType[] = [
    {
      title: '账号名',
      field: 'account',
      input: true,
      data: userInfoData.account,
      buttonText: '修改',
      btnOnClick: (item: AigcListType) => {
        console.log(item)
      }
    },
    {
      title: '密码',
      field: 'pwd',
      buttonText: '修改',
      btnOnClick: () => {}
    }
  ]

  return (
    <div>
      <AigcCard>
        <AigcList list={userInfoColunm} />
      </AigcCard>
    </div>
  )
}
